package com.lzy.mall.product.service.impl;

import com.lzy.mall.product.entity.PmsSkuImages;
import com.lzy.mall.product.dao.PmsSkuImagesDao;
import com.lzy.mall.product.service.PmsSkuImagesService;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * sku图片(PmsSkuImages)表服务实现类
 *
 * @author lzy
 * @since 2021-08-25 11:41:19
 */
@Service
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class PmsSkuImagesServiceImpl implements PmsSkuImagesService {
    private final PmsSkuImagesDao skuImagesDao;

    @Override
    public void saveBatch(List<PmsSkuImages> skuImages) {
        skuImagesDao.insertBatch(skuImages);
    }

    @Override
    public List<PmsSkuImages> getBySkuId(Long skuId) {
        List<PmsSkuImages> select = skuImagesDao.createLambdaQuery()
                .andEq(PmsSkuImages::getSkuId, skuId)
                .select();
        return select;
    }
}
